.class public Lcom/estrongs/fs/impl/usb/f;
.super Ljava/lang/Object;
.source "UsbMassStorageDevice.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/fs/impl/usb/f$d;,
        Lcom/estrongs/fs/impl/usb/f$b;,
        Lcom/estrongs/fs/impl/usb/f$c;
    }
.end annotation


# static fields
.field private static final p:Ljava/lang/String; = "f"

.field private static q:I = 0x7d0

.field private static r:I = 0x30d40


# instance fields
.field private a:Landroid/hardware/usb/UsbManager;

.field private b:Landroid/hardware/usb/UsbDeviceConnection;

.field private c:Landroid/hardware/usb/UsbDevice;

.field private d:Landroid/hardware/usb/UsbInterface;

.field private e:Landroid/hardware/usb/UsbEndpoint;

.field private f:Landroid/hardware/usb/UsbEndpoint;

.field private g:Les/a50;

.field private h:Les/i60;

.field private i:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Les/h60;",
            ">;"
        }
    .end annotation
.end field

.field private j:Landroid/content/Context;

.field private final k:Ljava/lang/Object;

.field private l:Lcom/estrongs/fs/impl/usb/f$d;

.field private m:I

.field private n:Landroid/content/BroadcastReceiver;

.field private o:Z


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method private constructor <init>(Landroid/hardware/usb/UsbManager;Landroid/hardware/usb/UsbDevice;Landroid/hardware/usb/UsbInterface;Landroid/hardware/usb/UsbEndpoint;Landroid/hardware/usb/UsbEndpoint;)V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->i:Ljava/util/List;

    .line 3
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->j:Landroid/content/Context;

    .line 4
    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    iput-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->k:Ljava/lang/Object;

    const/4 v0, 0x0

    .line 5
    iput-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->l:Lcom/estrongs/fs/impl/usb/f$d;

    const/4 v1, 0x0

    .line 6
    iput v1, p0, Lcom/estrongs/fs/impl/usb/f;->m:I

    .line 7
    iput-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->n:Landroid/content/BroadcastReceiver;

    .line 8
    iput-boolean v1, p0, Lcom/estrongs/fs/impl/usb/f;->o:Z

    .line 9
    iput-object p1, p0, Lcom/estrongs/fs/impl/usb/f;->a:Landroid/hardware/usb/UsbManager;

    .line 10
    iput-object p2, p0, Lcom/estrongs/fs/impl/usb/f;->c:Landroid/hardware/usb/UsbDevice;

    .line 11
    iput-object p3, p0, Lcom/estrongs/fs/impl/usb/f;->d:Landroid/hardware/usb/UsbInterface;

    .line 12
    iput-object p4, p0, Lcom/estrongs/fs/impl/usb/f;->e:Landroid/hardware/usb/UsbEndpoint;

    .line 13
    iput-object p5, p0, Lcom/estrongs/fs/impl/usb/f;->f:Landroid/hardware/usb/UsbEndpoint;

    return-void
.end method

.method private a(I)Lcom/estrongs/fs/impl/usb/a;
    .locals 2

    .line 12
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x12

    if-lt v0, v1, :cond_0

    .line 13
    new-instance v0, Lcom/estrongs/fs/impl/usb/f$c;

    invoke-direct {v0, p0, p1}, Lcom/estrongs/fs/impl/usb/f$c;-><init>(Lcom/estrongs/fs/impl/usb/f;I)V

    goto :goto_0

    .line 14
    :cond_0
    new-instance v0, Lcom/estrongs/fs/impl/usb/f$b;

    invoke-direct {v0, p0, p1}, Lcom/estrongs/fs/impl/usb/f$b;-><init>(Lcom/estrongs/fs/impl/usb/f;I)V

    :goto_0
    return-object v0
.end method

.method static synthetic a(Lcom/estrongs/fs/impl/usb/f;)Ljava/lang/Object;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/fs/impl/usb/f;->k:Ljava/lang/Object;

    return-object p0
.end method

.method public static a(Landroid/hardware/usb/UsbDevice;)Ljava/lang/String;
    .locals 2
    .annotation build Landroidx/annotation/NonNull;
    .end annotation

    .line 20
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "usb://"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p0}, Landroid/hardware/usb/UsbDevice;->getDeviceId()I

    move-result p0

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string p0, "/"

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

.method static synthetic b(Lcom/estrongs/fs/impl/usb/f;)Z
    .locals 0

    .line 1
    iget-boolean p0, p0, Lcom/estrongs/fs/impl/usb/f;->o:Z

    return p0
.end method

.method static synthetic c(Lcom/estrongs/fs/impl/usb/f;)Landroid/hardware/usb/UsbDeviceConnection;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/fs/impl/usb/f;->b:Landroid/hardware/usb/UsbDeviceConnection;

    return-object p0
.end method

.method static synthetic d(Lcom/estrongs/fs/impl/usb/f;)Landroid/hardware/usb/UsbEndpoint;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/fs/impl/usb/f;->f:Landroid/hardware/usb/UsbEndpoint;

    return-object p0
.end method

.method static synthetic e(Lcom/estrongs/fs/impl/usb/f;)Landroid/hardware/usb/UsbEndpoint;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/fs/impl/usb/f;->e:Landroid/hardware/usb/UsbEndpoint;

    return-object p0
.end method

.method static synthetic f(Lcom/estrongs/fs/impl/usb/f;)Landroid/hardware/usb/UsbDevice;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/fs/impl/usb/f;->c:Landroid/hardware/usb/UsbDevice;

    return-object p0
.end method

.method static synthetic g(Lcom/estrongs/fs/impl/usb/f;)Lcom/estrongs/fs/impl/usb/f$d;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/fs/impl/usb/f;->l:Lcom/estrongs/fs/impl/usb/f$d;

    return-object p0
.end method

.method static synthetic j()I
    .locals 1

    .line 1
    sget v0, Lcom/estrongs/fs/impl/usb/f;->r:I

    return v0
.end method

.method private k()V
    .locals 3

    .line 1
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->k:Ljava/lang/Object;

    monitor-enter v0

    .line 2
    :try_start_0
    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->b:Landroid/hardware/usb/UsbDeviceConnection;

    if-nez v1, :cond_0

    .line 3
    monitor-exit v0

    return-void

    .line 4
    :cond_0
    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->b:Landroid/hardware/usb/UsbDeviceConnection;

    iget-object v2, p0, Lcom/estrongs/fs/impl/usb/f;->d:Landroid/hardware/usb/UsbInterface;

    invoke-virtual {v1, v2}, Landroid/hardware/usb/UsbDeviceConnection;->releaseInterface(Landroid/hardware/usb/UsbInterface;)Z

    move-result v1

    if-nez v1, :cond_1

    .line 5
    sget-object v1, Lcom/estrongs/fs/impl/usb/f;->p:Ljava/lang/String;

    const-string v2, "could not release interface!"

    invoke-static {v1, v2}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 6
    :cond_1
    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->b:Landroid/hardware/usb/UsbDeviceConnection;

    invoke-virtual {v1}, Landroid/hardware/usb/UsbDeviceConnection;->close()V

    const/4 v1, 0x0

    .line 7
    iput-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->b:Landroid/hardware/usb/UsbDeviceConnection;

    .line 8
    monitor-exit v0

    return-void

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method private l()V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/estrongs/fs/impl/usb/UsbFsException;
        }
    .end annotation

    .line 1
    iget v0, p0, Lcom/estrongs/fs/impl/usb/f;->m:I

    if-nez v0, :cond_0

    .line 2
    invoke-virtual {p0}, Lcom/estrongs/fs/impl/usb/f;->g()V

    :cond_0
    return-void
.end method

.method public static m()[Lcom/estrongs/fs/impl/usb/f;
    .locals 14

    .line 1
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v0

    const-string v1, "usb"

    invoke-virtual {v0, v1}, Landroid/app/Application;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/hardware/usb/UsbManager;

    .line 2
    new-instance v7, Ljava/util/ArrayList;

    invoke-direct {v7}, Ljava/util/ArrayList;-><init>()V

    const/4 v8, 0x0

    if-eqz v0, :cond_8

    .line 3
    :try_start_0
    invoke-virtual {v0}, Landroid/hardware/usb/UsbManager;->getDeviceList()Ljava/util/HashMap;

    move-result-object v1

    invoke-virtual {v1}, Ljava/util/HashMap;->values()Ljava/util/Collection;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v9

    :cond_0
    invoke-interface {v9}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_8

    invoke-interface {v9}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    move-object v10, v1

    check-cast v10, Landroid/hardware/usb/UsbDevice;

    .line 4
    invoke-virtual {v10}, Landroid/hardware/usb/UsbDevice;->getInterfaceCount()I

    move-result v11

    const/4 v12, 0x0

    :goto_0
    if-ge v12, v11, :cond_0

    .line 5
    invoke-virtual {v10, v12}, Landroid/hardware/usb/UsbDevice;->getInterface(I)Landroid/hardware/usb/UsbInterface;

    move-result-object v4

    .line 6
    invoke-virtual {v4}, Landroid/hardware/usb/UsbInterface;->getInterfaceClass()I

    move-result v1

    const/16 v2, 0x8

    if-ne v1, v2, :cond_7

    .line 7
    invoke-virtual {v4}, Landroid/hardware/usb/UsbInterface;->getInterfaceSubclass()I

    move-result v1

    const/4 v2, 0x6

    if-ne v1, v2, :cond_7

    .line 8
    invoke-virtual {v4}, Landroid/hardware/usb/UsbInterface;->getInterfaceProtocol()I

    move-result v1

    const/16 v2, 0x50

    if-eq v1, v2, :cond_1

    goto :goto_4

    .line 9
    :cond_1
    invoke-virtual {v4}, Landroid/hardware/usb/UsbInterface;->getEndpointCount()I

    move-result v1

    const/4 v2, 0x2

    if-eq v1, v2, :cond_2

    .line 10
    sget-object v2, Lcom/estrongs/fs/impl/usb/f;->p:Ljava/lang/String;

    const-string v3, "inteface endpoint count != 2"

    invoke-static {v2, v3}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V

    :cond_2
    const/4 v2, 0x0

    move-object v5, v2

    move-object v6, v5

    const/4 v2, 0x0

    :goto_1
    if-ge v2, v1, :cond_4

    .line 11
    invoke-virtual {v4, v2}, Landroid/hardware/usb/UsbInterface;->getEndpoint(I)Landroid/hardware/usb/UsbEndpoint;

    move-result-object v3

    .line 12
    invoke-virtual {v3}, Landroid/hardware/usb/UsbEndpoint;->getDirection()I

    move-result v13

    if-nez v13, :cond_3

    move-object v6, v3

    goto :goto_2

    :cond_3
    move-object v5, v3

    :goto_2
    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    :cond_4
    if-eqz v6, :cond_6

    if-nez v5, :cond_5

    goto :goto_3

    .line 13
    :cond_5
    new-instance v13, Lcom/estrongs/fs/impl/usb/f;

    move-object v1, v13

    move-object v2, v0

    move-object v3, v10

    invoke-direct/range {v1 .. v6}, Lcom/estrongs/fs/impl/usb/f;-><init>(Landroid/hardware/usb/UsbManager;Landroid/hardware/usb/UsbDevice;Landroid/hardware/usb/UsbInterface;Landroid/hardware/usb/UsbEndpoint;Landroid/hardware/usb/UsbEndpoint;)V

    invoke-virtual {v7, v13}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_4

    .line 14
    :cond_6
    :goto_3
    sget-object v1, Lcom/estrongs/fs/impl/usb/f;->p:Ljava/lang/String;

    const-string v2, "Not all needed endpoints found!"

    invoke-static {v1, v2}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_7
    :goto_4
    add-int/lit8 v12, v12, 0x1

    goto :goto_0

    :catch_0
    :cond_8
    new-array v0, v8, [Lcom/estrongs/fs/impl/usb/f;

    .line 15
    invoke-virtual {v7, v0}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Lcom/estrongs/fs/impl/usb/f;

    return-object v0
.end method

.method private n()V
    .locals 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lcom/estrongs/fs/impl/usb/UsbFsException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->h:Les/i60;

    invoke-interface {v0}, Les/i60;->a()Ljava/util/Collection;

    move-result-object v0

    .line 2
    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v0

    const/4 v1, 0x0

    move-object v2, v1

    move-object v3, v2

    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Les/j60;

    .line 3
    :try_start_0
    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v6, p0, Lcom/estrongs/fs/impl/usb/f;->c:Landroid/hardware/usb/UsbDevice;

    invoke-virtual {v6}, Landroid/hardware/usb/UsbDevice;->getDeviceId()I

    move-result v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v6, ""

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    iget-object v6, p0, Lcom/estrongs/fs/impl/usb/f;->g:Les/a50;

    invoke-static {v5, v4, v6}, Les/h60;->a(Ljava/lang/String;Les/j60;Les/a50;)Les/h60;

    move-result-object v4
    :try_end_0
    .catch Lcom/estrongs/fs/impl/usb/UsbFsException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_2

    :catch_0
    move-exception v3

    goto :goto_1

    :catch_1
    move-exception v2

    :goto_1
    move-object v4, v1

    :goto_2
    if-eqz v4, :cond_0

    .line 4
    iget-object v5, p0, Lcom/estrongs/fs/impl/usb/f;->i:Ljava/util/List;

    invoke-interface {v5, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 5
    :cond_1
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->i:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-nez v0, :cond_4

    if-nez v2, :cond_3

    if-nez v3, :cond_2

    goto :goto_3

    .line 6
    :cond_2
    throw v3

    .line 7
    :cond_3
    throw v2

    :cond_4
    :goto_3
    return-void
.end method

.method private o()I
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lcom/estrongs/fs/impl/usb/UsbFsException;
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Lcom/estrongs/fs/impl/usb/f;->k()V

    .line 2
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->a:Landroid/hardware/usb/UsbManager;

    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->c:Landroid/hardware/usb/UsbDevice;

    invoke-virtual {v0, v1}, Landroid/hardware/usb/UsbManager;->openDevice(Landroid/hardware/usb/UsbDevice;)Landroid/hardware/usb/UsbDeviceConnection;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->b:Landroid/hardware/usb/UsbDeviceConnection;

    const/4 v1, -0x1

    if-nez v0, :cond_0

    .line 3
    sget-object v0, Lcom/estrongs/fs/impl/usb/f;->p:Ljava/lang/String;

    const-string v2, "deviceConnetion is null!"

    invoke-static {v0, v2}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V

    return v1

    .line 4
    :cond_0
    iget-object v2, p0, Lcom/estrongs/fs/impl/usb/f;->d:Landroid/hardware/usb/UsbInterface;

    const/4 v3, 0x1

    invoke-virtual {v0, v2, v3}, Landroid/hardware/usb/UsbDeviceConnection;->claimInterface(Landroid/hardware/usb/UsbInterface;Z)Z

    move-result v0

    if-nez v0, :cond_1

    .line 5
    sget-object v0, Lcom/estrongs/fs/impl/usb/f;->p:Ljava/lang/String;

    const-string v2, "could not claim interface!"

    invoke-static {v0, v2}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V

    return v1

    .line 6
    :cond_1
    sget v0, Lcom/estrongs/fs/impl/usb/f;->q:I

    invoke-direct {p0, v0}, Lcom/estrongs/fs/impl/usb/f;->a(I)Lcom/estrongs/fs/impl/usb/a;

    move-result-object v0

    .line 7
    invoke-static {v0}, Les/b50;->a(Lcom/estrongs/fs/impl/usb/a;)Les/a50;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->g:Les/a50;

    .line 8
    invoke-interface {v0}, Les/a50;->init()V

    .line 9
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->g:Les/a50;

    invoke-static {v0}, Les/k60;->a(Les/a50;)Les/i60;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->h:Les/i60;

    if-eqz v0, :cond_3

    .line 10
    invoke-direct {p0}, Lcom/estrongs/fs/impl/usb/f;->n()V

    .line 11
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->g:Les/a50;

    instance-of v0, v0, Lcom/estrongs/fs/impl/usb/driver/scsi/b;

    if-eqz v0, :cond_2

    .line 12
    sget v0, Lcom/estrongs/fs/impl/usb/f;->r:I

    invoke-direct {p0, v0}, Lcom/estrongs/fs/impl/usb/f;->a(I)Lcom/estrongs/fs/impl/usb/a;

    move-result-object v0

    .line 13
    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->g:Les/a50;

    check-cast v1, Lcom/estrongs/fs/impl/usb/driver/scsi/b;

    invoke-virtual {v1, v0}, Lcom/estrongs/fs/impl/usb/driver/scsi/b;->a(Lcom/estrongs/fs/impl/usb/a;)V

    :cond_2
    return v3

    .line 14
    :cond_3
    new-instance v0, Lcom/estrongs/fs/impl/usb/UsbFsException;

    sget-object v1, Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;->USB_ERROR_TYPE_NOT_SUPPORTED:Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;

    const-string v2, "unsupported mbr type"

    invoke-direct {v0, v2, v1}, Lcom/estrongs/fs/impl/usb/UsbFsException;-><init>(Ljava/lang/String;Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;)V

    throw v0
.end method


# virtual methods
.method public a()V
    .locals 2

    .line 15
    iget v0, p0, Lcom/estrongs/fs/impl/usb/f;->m:I

    if-nez v0, :cond_0

    return-void

    :cond_0
    const/4 v0, 0x0

    .line 16
    iput v0, p0, Lcom/estrongs/fs/impl/usb/f;->m:I

    .line 17
    invoke-direct {p0}, Lcom/estrongs/fs/impl/usb/f;->k()V

    .line 18
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->n:Landroid/content/BroadcastReceiver;

    if-eqz v0, :cond_1

    .line 19
    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->j:Landroid/content/Context;

    invoke-virtual {v1, v0}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    :cond_1
    return-void
.end method

.method public a(Lcom/estrongs/fs/impl/usb/f$d;)V
    .locals 4

    .line 2
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->k:Ljava/lang/Object;

    monitor-enter v0

    .line 3
    :try_start_0
    new-instance v1, Landroid/content/IntentFilter;

    const-string v2, "com.estrongs.fs.impl.usb.USB_PERMISSION"

    invoke-direct {v1, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    .line 4
    iget-object v2, p0, Lcom/estrongs/fs/impl/usb/f;->n:Landroid/content/BroadcastReceiver;

    if-eqz v2, :cond_0

    .line 5
    iget-object v2, p0, Lcom/estrongs/fs/impl/usb/f;->j:Landroid/content/Context;

    iget-object v3, p0, Lcom/estrongs/fs/impl/usb/f;->n:Landroid/content/BroadcastReceiver;

    invoke-virtual {v2, v3}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 6
    :cond_0
    new-instance v2, Lcom/estrongs/fs/impl/usb/f$a;

    invoke-direct {v2, p0}, Lcom/estrongs/fs/impl/usb/f$a;-><init>(Lcom/estrongs/fs/impl/usb/f;)V

    iput-object v2, p0, Lcom/estrongs/fs/impl/usb/f;->n:Landroid/content/BroadcastReceiver;

    .line 7
    iget-object v3, p0, Lcom/estrongs/fs/impl/usb/f;->j:Landroid/content/Context;

    invoke-virtual {v3, v2, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 8
    iput-object p1, p0, Lcom/estrongs/fs/impl/usb/f;->l:Lcom/estrongs/fs/impl/usb/f$d;

    .line 9
    iget-object p1, p0, Lcom/estrongs/fs/impl/usb/f;->j:Landroid/content/Context;

    new-instance v1, Landroid/content/Intent;

    const-string v2, "com.estrongs.fs.impl.usb.USB_PERMISSION"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const/4 v2, 0x0

    invoke-static {p1, v2, v1, v2}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object p1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 10
    :try_start_1
    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->a:Landroid/hardware/usb/UsbManager;

    iget-object v2, p0, Lcom/estrongs/fs/impl/usb/f;->c:Landroid/hardware/usb/UsbDevice;

    invoke-virtual {v1, v2, p1}, Landroid/hardware/usb/UsbManager;->requestPermission(Landroid/hardware/usb/UsbDevice;Landroid/app/PendingIntent;)V
    :try_end_1
    .catch Ljava/lang/SecurityException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 11
    :catch_0
    :try_start_2
    monitor-exit v0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit v0
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    throw p1
.end method

.method public b()Ljava/lang/String;
    .locals 2

    .line 2
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->c:Landroid/hardware/usb/UsbDevice;

    invoke-virtual {v1}, Landroid/hardware/usb/UsbDevice;->getDeviceId()I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, ""

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public c()Ljava/lang/String;
    .locals 2

    .line 2
    invoke-static {}, Lcom/estrongs/fs/impl/usb/e;->c()[Lcom/estrongs/fs/impl/usb/f;

    move-result-object v0

    if-eqz v0, :cond_0

    const/4 v1, 0x1

    .line 3
    array-length v0, v0

    if-ne v1, v0, :cond_0

    sget-object v0, Lcom/estrongs/android/pop/j;->z:Ljava/lang/String;

    if-eqz v0, :cond_0

    return-object v0

    .line 4
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "USB"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->c:Landroid/hardware/usb/UsbDevice;

    invoke-virtual {v1}, Landroid/hardware/usb/UsbDevice;->getDeviceId()I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public d()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Les/h60;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/estrongs/fs/impl/usb/UsbFsException;
        }
    .end annotation

    .line 2
    invoke-direct {p0}, Lcom/estrongs/fs/impl/usb/f;->l()V

    .line 3
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->i:Ljava/util/List;

    return-object v0
.end method

.method public e()Ljava/lang/String;
    .locals 2

    .line 2
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "usb://"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->c:Landroid/hardware/usb/UsbDevice;

    invoke-virtual {v1}, Landroid/hardware/usb/UsbDevice;->getDeviceId()I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, "/"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public f()Z
    .locals 2

    .line 2
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->a:Landroid/hardware/usb/UsbManager;

    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->c:Landroid/hardware/usb/UsbDevice;

    invoke-virtual {v0, v1}, Landroid/hardware/usb/UsbManager;->hasPermission(Landroid/hardware/usb/UsbDevice;)Z

    move-result v0

    return v0
.end method

.method public g()V
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/estrongs/fs/impl/usb/UsbFsException;
        }
    .end annotation

    .line 2
    iget-object v0, p0, Lcom/estrongs/fs/impl/usb/f;->k:Ljava/lang/Object;

    monitor-enter v0

    .line 3
    :try_start_0
    iget v1, p0, Lcom/estrongs/fs/impl/usb/f;->m:I

    if-eqz v1, :cond_0

    .line 4
    monitor-exit v0

    return-void

    .line 5
    :cond_0
    iget-object v1, p0, Lcom/estrongs/fs/impl/usb/f;->a:Landroid/hardware/usb/UsbManager;

    iget-object v2, p0, Lcom/estrongs/fs/impl/usb/f;->c:Landroid/hardware/usb/UsbDevice;

    invoke-virtual {v1, v2}, Landroid/hardware/usb/UsbManager;->hasPermission(Landroid/hardware/usb/UsbDevice;)Z

    move-result v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v1, :cond_2

    const/4 v1, -0x1

    .line 6
    :try_start_1
    invoke-direct {p0}, Lcom/estrongs/fs/impl/usb/f;->o()I

    move-result v2

    iput v2, p0, Lcom/estrongs/fs/impl/usb/f;->m:I
    :try_end_1
    .catch Lcom/estrongs/fs/impl/usb/UsbFsException; {:try_start_1 .. :try_end_1} :catch_2
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    const/4 v3, 0x1

    if-ne v2, v3, :cond_1

    .line 7
    :try_start_2
    monitor-exit v0
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    return-void

    .line 8
    :cond_1
    :try_start_3
    new-instance v2, Lcom/estrongs/fs/impl/usb/UsbFsException;

    const-string v3, "fail to connect usb device"

    sget-object v4, Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;->USB_ERROR_INIT_FAIL:Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;

    invoke-direct {v2, v3, v4}, Lcom/estrongs/fs/impl/usb/UsbFsException;-><init>(Ljava/lang/String;Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;)V

    throw v2
    :try_end_3
    .catch Lcom/estrongs/fs/impl/usb/UsbFsException; {:try_start_3 .. :try_end_3} :catch_2
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_1
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_0
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    :catch_0
    move-exception v2

    .line 9
    :try_start_4
    iput v1, p0, Lcom/estrongs/fs/impl/usb/f;->m:I

    .line 10
    new-instance v1, Lcom/estrongs/fs/impl/usb/UsbFsException;

    sget-object v3, Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;->USB_ERROR_OPERATION_FAILED:Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;

    invoke-direct {v1, v2, v3}, Lcom/estrongs/fs/impl/usb/UsbFsException;-><init>(Ljava/lang/Throwable;Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;)V

    throw v1

    :catch_1
    move-exception v2

    .line 11
    iput v1, p0, Lcom/estrongs/fs/impl/usb/f;->m:I

    .line 12
    new-instance v1, Lcom/estrongs/fs/impl/usb/UsbFsException;

    sget-object v3, Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;->USB_ERROR_IO_ERROR:Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;

    invoke-direct {v1, v2, v3}, Lcom/estrongs/fs/impl/usb/UsbFsException;-><init>(Ljava/lang/Throwable;Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;)V

    throw v1

    :catch_2
    move-exception v2

    .line 13
    iput v1, p0, Lcom/estrongs/fs/impl/usb/f;->m:I

    .line 14
    invoke-direct {p0}, Lcom/estrongs/fs/impl/usb/f;->k()V

    .line 15
    throw v2

    .line 16
    :cond_2
    new-instance v1, Lcom/estrongs/fs/impl/usb/UsbFsException;

    const-string v2, "Missing permission to access device"

    sget-object v3, Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;->USB_ERROR_MISSING_PERMISSION:Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;

    invoke-direct {v1, v2, v3}, Lcom/estrongs/fs/impl/usb/UsbFsException;-><init>(Ljava/lang/String;Lcom/estrongs/fs/impl/usb/UsbFsException$ERROR_CODE;)V

    throw v1

    :catchall_0
    move-exception v1

    .line 17
    monitor-exit v0
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    throw v1
.end method

.method public h()Z
    .locals 1

    .line 1
    iget-boolean v0, p0, Lcom/estrongs/fs/impl/usb/f;->o:Z

    return v0
.end method

.method public i()V
    .locals 1

    const/4 v0, 0x1

    .line 1
    iput-boolean v0, p0, Lcom/estrongs/fs/impl/usb/f;->o:Z

    return-void
.end method
